import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/page/layout/index.vue'

export const routers = [
  {
    path: '/',
    name: 'Home',
    component: Layout,
    redirect: '/tree1',
    meta: { title: '' },
    children: [
      {
        path: '/tree1',
        name: 'tree1Page',
        meta: { title: '选择全部子项树' },
        component: () => import('@/views/tree/tree1.vue')
      }
    ]
  },
  { path: '/:pathMatch(.*)*', hidden: true, redirect: '/' }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routers
})

export default router
